<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BabyOS: b_lunar.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="2.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">BabyOS
   &#160;<span id="projectnumber">V0.0.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_b9223522bb56aee4ab59f7ba381d2163.html">bos</a></li><li class="navelem"><a class="el" href="dir_f2a2cc749b6bfcea90db6730434b0bd6.html">core</a></li><li class="navelem"><a class="el" href="dir_7991448cbe81caff9afaadef11b942e8.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">b_lunar.c</div>  </div>
</div><!--header-->
<div class="contents">
<a href="b__lunar_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="comment">/*Includes ----------------------------------------------*/</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="b__lunar_8h.html">b_lunar.h</a>&quot;</span>  </div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#if _LUNAR_ENABLE</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;<span class="keyword">const</span> <span class="keyword">static</span> uint32_t bLunarCalendarTable[199] = {</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <span class="comment">/*1901-1910*/</span></div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    0x04AE53, 0x0A5748, 0x5526BD, 0x0D2650, 0x0D9544, 0x46AAB9, 0x056A4D, 0x09AD42, 0x24AEB6, 0x04AE4A,</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="comment">/*1911-1920*/</span></div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    0x6A4DBE, 0x0A4D52, 0x0D2546, 0x5D52BA, 0x0B544E, 0x0D6A43, 0x296D37, 0x095B4B, 0x749BC1, 0x049754,</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    <span class="comment">/*1921-1930*/</span></div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    0x0A4B48, 0x5B25BC, 0x06A550, 0x06D445, 0x4ADAB8, 0x02B64D, 0x095742, 0x2497B7, 0x04974A, 0x664B3E,</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    <span class="comment">/*1931-1940*/</span></div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    0x0D4A51, 0x0EA546, 0x56D4BA, 0x05AD4E, 0x02B644, 0x393738, 0x092E4B, 0x7C96BF, 0x0C9553, 0x0D4A48,</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <span class="comment">/*1941-1950*/</span></div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    0x6DA53B, 0x0B554F, 0x056A45, 0x4AADB9, 0x025D4D, 0x092D42, 0x2C95B6, 0x0A954A, 0x7B4ABD, 0x06CA51,</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    <span class="comment">/*1951-1960*/</span></div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    0x0B5546, 0x555ABB, 0x04DA4E, 0x0A5B43, 0x352BB8, 0x052B4C, 0x8A953F, 0x0E9552, 0x06AA48, 0x6AD53C,</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <span class="comment">/*1961-1970*/</span></div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    0x0AB54F, 0x04B645, 0x4A5739, 0x0A574D, 0x052642, 0x3E9335, 0x0D9549, 0x75AABE, 0x056A51, 0x096D46,</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    <span class="comment">/*1971-1980*/</span></div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    0x54AEBB, 0x04AD4F, 0x0A4D43, 0x4D26B7, 0x0D254B, 0x8D52BF, 0x0B5452, 0x0B6A47, 0x696D3C, 0x095B50,</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    <span class="comment">/*1981-1990*/</span></div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    0x049B45, 0x4A4BB9, 0x0A4B4D, 0xAB25C2, 0x06A554, 0x06D449, 0x6ADA3D, 0x0AB651, 0x093746, 0x5497BB,</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    <span class="comment">/*1991-2000*/</span></div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    0x04974F, 0x064B44, 0x36A537, 0x0EA54A, 0x86B2BF, 0x05AC53, 0x0AB647, 0x5936BC, 0x092E50, 0x0C9645,</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <span class="comment">/*2001-2010*/</span></div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    0x4D4AB8, 0x0D4A4C, 0x0DA541, 0x25AAB6, 0x056A49, 0x7AADBD, 0x025D52, 0x092D47, 0x5C95BA, 0x0A954E,</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="comment">/*2011-2020*/</span></div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    0x0B4A43, 0x4B5537, 0x0AD54A, 0x955ABF, 0x04BA53, 0x0A5B48, 0x652BBC, 0x052B50, 0x0A9345, 0x474AB9,</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="comment">/*2021-2030*/</span></div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    0x06AA4C, 0x0AD541, 0x24DAB6, 0x04B64A, 0x69573D, 0x0A4E51, 0x0D2646, 0x5E933A, 0x0D534D, 0x05AA43,</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <span class="comment">/*2031-2040*/</span></div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    0x36B537, 0x096D4B, 0xB4AEBF, 0x04AD53, 0x0A4D48, 0x6D25BC, 0x0D254F, 0x0D5244, 0x5DAA38, 0x0B5A4C,</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="comment">/*2041-2050*/</span></div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    0x056D41, 0x24ADB6, 0x049B4A, 0x7A4BBE, 0x0A4B51, 0x0AA546, 0x5B52BA, 0x06D24E, 0x0ADA42, 0x355B37,</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <span class="comment">/*2051-2060*/</span></div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    0x09374B, 0x8497C1, 0x049753, 0x064B48, 0x66A53C, 0x0EA54F, 0x06B244, 0x4AB638, 0x0AAE4C, 0x092E42,</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    <span class="comment">/*2061-2070*/</span></div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    0x3C9735, 0x0C9649, 0x7D4ABD, 0x0D4A51, 0x0DA545, 0x55AABA, 0x056A4E, 0x0A6D43, 0x452EB7, 0x052D4B,</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="comment">/*2071-2080*/</span></div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    0x8A95BF, 0x0A9553, 0x0B4A47, 0x6B553B, 0x0AD54F, 0x055A45, 0x4A5D38, 0x0A5B4C, 0x052B42, 0x3A93B6,</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    <span class="comment">/*2081-2090*/</span></div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    0x069349, 0x7729BD, 0x06AA51, 0x0AD546, 0x54DABA, 0x04B64E, 0x0A5743, 0x452738, 0x0D264A, 0x8E933E,</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <span class="comment">/*2091-2099*/</span></div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    0x0D5252, 0x0DAA47, 0x66B53B, 0x056D4F, 0x04AE45, 0x4A4EB9, 0x0A4D4C, 0x0D1541, 0x2D92B5</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;};</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;<span class="keyword">const</span> <span class="keyword">static</span> uint32_t bLunarMonthSum[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___l_u_n_a_r___exported___functions.html#ga2e56b0cadb491906cddfebe953e796a9">bSolar2Lunar</a>(uint16_t syear, uint8_t smonth, uint8_t sday, <a class="code" href="structb_lunar_info__t.html">bLunarInfo_t</a> *plunar)</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;{</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    <span class="keywordtype">int</span> l_year, s_year, days_m;      </div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;    <span class="keywordtype">int</span> index, flag;  </div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    <span class="keywordflow">if</span>(plunar == <a class="code" href="b__config_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;    {</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;        <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    }</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    </div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    <span class="keywordflow">if</span>(((bLunarCalendarTable[syear - 1901] &amp; 0x0060) &gt;&gt; 5) == 1)</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    {</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;        l_year = (bLunarCalendarTable[syear - 1901] &amp; 0x001F) - 1;</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    }</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    <span class="keywordflow">else</span></div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    {</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;        l_year = (bLunarCalendarTable[syear - 1901] &amp; 0x001F) - 1 + 31;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    }</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    s_year = bLunarMonthSum[smonth - 1] + sday - 1;</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;    </div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    <span class="keywordflow">if</span>((!(syear % 4)) &amp;&amp; (smonth &gt; 2))</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    {</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;        s_year++;</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    }</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    <span class="keywordflow">if</span>(s_year &gt;= l_year) </div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    { </div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;        s_year -= l_year;</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;        smonth = 1;</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;        index = 1;</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;        flag = 0;</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;        <span class="keywordflow">if</span>((bLunarCalendarTable[syear - 1901] &amp; (0x80000 &gt;&gt; (index - 1)) ) == 0)</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;        {</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;            days_m = 29;</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;        }</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;        <span class="keywordflow">else</span></div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;        {</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;            days_m = 30;</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;        }</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;        <span class="keywordflow">while</span>(s_year &gt;= days_m) </div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;        {</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;            s_year -= days_m;</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;            index++;</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;            <span class="keywordflow">if</span> (smonth == ((bLunarCalendarTable[syear - 1901] &amp; 0xF00000) &gt;&gt; 20)) </div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;            {</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;                flag = ~flag;</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;                <span class="keywordflow">if</span>(flag == 0)</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;                {</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;                    smonth++;</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;                }</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;            } </div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;            <span class="keywordflow">else</span> </div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;            {</div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;                smonth++;</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;            }</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;            <span class="keywordflow">if</span>((bLunarCalendarTable[syear - 1901] &amp; (0x80000 &gt;&gt; (index - 1)) ) == 0)</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;            {</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;                days_m = 29;</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;            }</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;            <span class="keywordflow">else</span></div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;            {</div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;                days_m = 30;</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;            }</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;        }</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;        sday = s_year + 1;</div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;    } </div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;    <span class="keywordflow">else</span> </div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    { </div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;        l_year -= s_year;</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;        syear--;</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;        smonth = 12;</div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;        <span class="keywordflow">if</span>(((bLunarCalendarTable[syear - 1901] &amp; 0xF00000) &gt;&gt; 20) == 0) </div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;        {</div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;            index = 12;</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;        } </div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;        <span class="keywordflow">else</span> </div><div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;        {</div><div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;            index = 13;</div><div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;        }</div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;        flag = 0;</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;        <span class="keywordflow">if</span>((bLunarCalendarTable[syear - 1901] &amp; (0x80000 &gt;&gt; (index - 1)) ) == 0) </div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;        {</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;            days_m = 29;</div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;        } </div><div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;        <span class="keywordflow">else</span> </div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;        {</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;            days_m = 30;</div><div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;        }</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;        <span class="keywordflow">while</span>(l_year &gt; days_m) </div><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;        {</div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;            l_year -= days_m;</div><div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;            index--;</div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;            <span class="keywordflow">if</span>(flag == 0) </div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;            {</div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;                smonth--;</div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;            }</div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;            <span class="keywordflow">if</span>(smonth == ((bLunarCalendarTable[syear - 1901] &amp; 0xF00000) &gt;&gt; 20)) </div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;            {</div><div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;                flag = ~flag;</div><div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;            }</div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;            <span class="keywordflow">if</span>((bLunarCalendarTable[syear - 1901] &amp; (0x80000 &gt;&gt; (index - 1)) ) == 0) </div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;            {</div><div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;                days_m = 29;</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;            } </div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;            <span class="keywordflow">else</span> </div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;            {</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;                days_m = 30;</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;            }</div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;        }</div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;        sday = days_m - l_year + 1;</div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;    }</div><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;    plunar-&gt;<a class="code" href="structb_lunar_info__t.html#a72369a1087b2aeffe374bb054cb97c12">day</a> = sday;</div><div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;    plunar-&gt;<a class="code" href="structb_lunar_info__t.html#a3e00faf7fbf9805e9ec4d2edd6339050">month</a> = smonth;</div><div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;    plunar-&gt;<a class="code" href="structb_lunar_info__t.html#a57ca98d8f6d4baf0fe41c583c7dcb0d5">year</a> = syear;</div><div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;    <span class="keywordflow">return</span> 0;    </div><div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;}</div><div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;</div><div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;</div><div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;<span class="comment">/************************ Copyright (c) 2019 Bean *****END OF FILE****/</span></div><div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;</div><div class="ttc" id="b__config_8h_html_a070d2ce7b6bb7e5c05602aa8c308d0c4"><div class="ttname"><a href="b__config_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a></div><div class="ttdeci">#define NULL</div><div class="ttdef"><b>Definition:</b> <a href="b__config_8h_source.html#l00042">b_config.h:42</a></div></div>
<div class="ttc" id="structb_lunar_info__t_html_a3e00faf7fbf9805e9ec4d2edd6339050"><div class="ttname"><a href="structb_lunar_info__t.html#a3e00faf7fbf9805e9ec4d2edd6339050">bLunarInfo_t::month</a></div><div class="ttdeci">uint8_t month</div><div class="ttdef"><b>Definition:</b> <a href="b__lunar_8h_source.html#l00060">b_lunar.h:60</a></div></div>
<div class="ttc" id="structb_lunar_info__t_html"><div class="ttname"><a href="structb_lunar_info__t.html">bLunarInfo_t</a></div><div class="ttdef"><b>Definition:</b> <a href="b__lunar_8h_source.html#l00057">b_lunar.h:57</a></div></div>
<div class="ttc" id="structb_lunar_info__t_html_a57ca98d8f6d4baf0fe41c583c7dcb0d5"><div class="ttname"><a href="structb_lunar_info__t.html#a57ca98d8f6d4baf0fe41c583c7dcb0d5">bLunarInfo_t::year</a></div><div class="ttdeci">uint16_t year</div><div class="ttdef"><b>Definition:</b> <a href="b__lunar_8h_source.html#l00059">b_lunar.h:59</a></div></div>
<div class="ttc" id="group___l_u_n_a_r___exported___functions_html_ga2e56b0cadb491906cddfebe953e796a9"><div class="ttname"><a href="group___l_u_n_a_r___exported___functions.html#ga2e56b0cadb491906cddfebe953e796a9">bSolar2Lunar</a></div><div class="ttdeci">int bSolar2Lunar(uint16_t syear, uint8_t smonth, uint8_t sday, bLunarInfo_t *plunar)</div></div>
<div class="ttc" id="structb_lunar_info__t_html_a72369a1087b2aeffe374bb054cb97c12"><div class="ttname"><a href="structb_lunar_info__t.html#a72369a1087b2aeffe374bb054cb97c12">bLunarInfo_t::day</a></div><div class="ttdeci">uint8_t day</div><div class="ttdef"><b>Definition:</b> <a href="b__lunar_8h_source.html#l00061">b_lunar.h:61</a></div></div>
<div class="ttc" id="b__lunar_8h_html"><div class="ttname"><a href="b__lunar_8h.html">b_lunar.h</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
